package com.aaa.controller;

import com.aaa.entity.Emp;
import com.aaa.service.EmpService;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: qy160-demo
 * @description:
 * @author: 闫克起2
 * @create: 2023-03-07 15:09
 **/
@RestController
@RequestMapping("/emp")
@Api(tags = "员工接口类")
@CrossOrigin
public class EmpController {
    @Autowired
    private EmpService empService;

    @GetMapping("getAll/{currentPage}/{pageSize}")
    @ApiOperation(value = "分页查询员工信息")
    public Result<IPage<Emp>> getAll(@ApiParam(value = "当前页码",required = true) @PathVariable Integer currentPage,
                                     @ApiParam(value = "每页的个数",required = true) @PathVariable Integer pageSize){
        return empService.listByPage(currentPage,pageSize);
    }
}
















